Answer:

No. The over-all control structure of the program was sequential execution of five tasks:

  1. Ask the user for the data.
  2. Calculate mpg for first tank of gas.
  3. Calculate mpg for second tank of gas.
  4. Calculate the difference between mpg rats.
  5. Write out the result.

The last task uses a two-way decision control structure, but that is a detail and does not change the over-all structure of the complete program.

Small Tasks as Design Problems

The answer to the question illustrates an important idea about designing programs:

A small task, part of the design for a complete program, is itself a small problem. The plan for solving this small problem has its own control structures.

In the example, the plan for the complete program was "sequential execution" of five small tasks. The plan for the last task involved a "two way decision".

QUESTION 11:

Are the control structures used to program a small task different from those used in big tasks?